#include "EnemyBody.h"
#include "Box2D\Dynamics\b2Body.h"


EnemyBody::EnemyBody(b2World *_World, b2BodyType _BodyStype) :BaseBody(_World, _BodyStype)
{
	makeBody();
}


EnemyBody::~EnemyBody()
{
}

void EnemyBody::makeBody()
{
	mColBody = BodyMaker::makeCicle(mWorld, mBodyStype, 50, b2Vec2(0, 0));
	mShaBody = BodyMaker::makeCicle(mWorld, b2_staticBody, 0, b2Vec2(0, 0));;
	b2DistanceJointDef jointDef;
	b2Vec2 worldCoordsAnchorPointA = mColBody->GetWorldPoint(b2Vec2(0, 0));
	b2Vec2 worldCoordsAnchorPointB = mShaBody->GetWorldPoint(b2Vec2(4, 4));
	jointDef.Initialize(mColBody, mShaBody, worldCoordsAnchorPointA, worldCoordsAnchorPointB);
	mWorld->CreateJoint(&jointDef);
}
